<template>
  <div v-if="userInfo">
    <!-- Home页的顶部导航栏组件 -->
    <open-map></open-map>
    <open-doclayer></open-doclayer>
    <Header />
    <map-toggle></map-toggle>
    <open-controls></open-controls>
    <right-menu></right-menu>
    <top-notification></top-notification>
  </div>
</template>

<script setup>
import axios from "axios";
import Header from "../../components/header/Header.vue";
import OpenMap from "../../components/MapComp/OpenMap.vue";
import OpenControls from "../../components/MapComp/OpenControls.vue";
import OpenDoclayer from "../../components/MapComp/OpenDoclayer.vue";
import MapToggle from "../../components/MapComp/MapToggle.vue";
import RightMenu from "../../components/RightMenu.vue";
import TopNotification from "./components/common/TopNotification.vue";
import { usePiniaStore } from "../../stores/pinia";
import { storeToRefs } from "pinia";
const piniaStore = usePiniaStore();
const { userInfo } = storeToRefs(piniaStore);

onMounted(async () => {
  // 首页一挂载，获取用户信息
  // 根据用户的type类型显示相应组件
  userInfo.value = JSON.parse(localStorage.getItem("userInfo"));
  // console.log(userInfo.value);
});
</script>

<style lang="scss" scoped>

</style>
